package com.ssm.helong.shop.controller;

import com.ssm.helong.shop.Dao.GoodsCategoryMapper;
import com.ssm.helong.shop.controller.vo.ShopsIndexCategoryVO;
import com.ssm.helong.shop.entity.GoodsCategory;
import com.ssm.helong.shop.service.GoodsCategoryService;
import com.ssm.helong.shop.util.Result;
import com.ssm.helong.shop.util.ResultGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
@RestController
@RequestMapping("/index")
public class IndexController {
    @Autowired
    private GoodsCategoryService goodsCategoryService;

    @GetMapping({"/goodsCategoryLayered"})
    public Result<List<GoodsCategory>> goodsCategoryLayered(){
        //分类数据
        List<GoodsCategory> categories = goodsCategoryService.findAllGoodsCategory();
        return  ResultGenerator.genSuccessResult(categories);
    }
}
